<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //基础的类型数据
    let num=1; //整数
    let num1= 0.1;//浮点数
    let str ='努力';//字符串
  //  let str1 = 努力;//错误的写法
    let null_str=null; //空对象
    undefined_str=undefined;//未定义
    let weidingyi;
    console.log("未定义："+weidingyi);
    let bool = true;//false

    //复杂类型的数据 数组
    //用数组 写出 唐僧师徒
    let tangsengshitu=['孙悟空',"猪八戒","沙和尚","白龙马"];
    console.log(tangsengshitu);

    //通过new Array 方式 创建的数组
    let tangsengshitu1 = new Array('孙悟空',"猪八戒","沙和尚","白龙马");
    console.log(tangsengshitu1);

    //通过new Array(arrayLength)
    let tangsengshitu2=new Array(4);
    //数组 下标 默认 从0开始
    tangsengshitu2[0]="孙悟空";
    tangsengshitu2[1]="猪八戒";
    tangsengshitu2[2]="沙和尚";
    tangsengshitu2[3]='白龙马';
    console.log(tangsengshitu2);

    let tangsengshitu3=new Array();
    tangsengshitu3.push("白龙马");
    tangsengshitu3.push("沙和尚");
    tangsengshitu3.push("猪八戒");
    tangsengshitu3.push("孙悟空");
    console.log(tangsengshitu3);
</script>
</html>